package mest.controller.hws;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import mest.service.hws.plan_productjob_workfinishService;
import mest.service.system.DBService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@CrossOrigin
@RequestMapping("/plan_productjob_workfinishController")
public class plan_productjob_workfinishController {

    @Resource
    private plan_productjob_workfinishService ppw;

    @Autowired
    private DBService dbService;

    /*/insertModel /delModel /updateByone  selectById  selectAll */
    @RequestMapping("/selectAll")
    public String selectAll(@RequestBody JSONObject json){
        Map<String,Object> map = json.toJavaObject(Map.class);
        map.put("theirDb",dbService.getDbName());
        System.out.println(map);
        return  ppw.selectAll(map);
    }

/*    @RequestMapping("/selectAll")
    public String selectAll(Integer page,Integer limit,Integer pwId){
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("page",page);
        map.put("limit",limit);
        map.put("pwId",pwId);
        map.put("theirDb",dbService.getDbName());
        System.out.println(map);
        return  ppw.selectAll(map);

    }*/

}
